\documentclass[11pt,a4paper]{article}
%\usepackage{syntonly}
%\usepackage[T1]{fontenc}
%\syntaxonly
%\author{Kong}
\title{User Manual}
\date{}
\pagestyle{headings}
\begin{document}
% generates the title
\maketitle
%			User Manual\\

%Project Title    : kh-shell\\
%Team Title       : One-Man\\
%Group Members    : Kong\\
%Document Version : 1.0.0

% The docment statement table
%\flushright
%\begin{flushleft}
\begin{flushright}
\begin{tabular}{|l|l|}
\hline
Project Title & kh-shell\\
\hline
Team Title & One-Man\\
\hline
Group Members & Kong\\
\hline
Document Version & 1.0.1\\
\hline
%Date & \date{}\\
Date & 2009.06.18\\
\hline
\end{tabular}
\end{flushright}
\begin{verbatim}


\end{verbatim}

\flushleft
\begin{enumerate}
\item \textbf{System Overview}

Kh-shell is supposed to be a lightweight shell running on unix-like system. It was developped by Kong at June 2009.\\
The software is written by C, developped and tested on ubuntu 8.04. The compiler is gcc 4.2.4, version controler is subversion.

\item \textbf{Installing}
\begin{verbatim}
First you need to download it from:

    http://code.google.com/p/kh-shell/downloads/list

or use svn client anonymously check out the latest project source code:

    # Non-members may check out a read-only working copy anonymously over HTTP. 
    svn checkout http://kh-shell.googlecode.com/svn/trunk/ kh-shell-read-only

You also need to install the devel package for glib2.0 and gcc. After
installing those, compile kh-shell the usual way:

    make
    ./kh-shell

And you are ready to go.
\end{verbatim}
\item \textbf{Software Compiling and Running Evironments}

\begin{center}
\begin{tabular}{|l|l|}
\hline
\textbf{Software Name} & kh-shell\\
\hline
\textbf{Version} & 1.0.2\\
\hline
\textbf{Operating System} & Unix-like\\
\hline
\textbf{Compiler} & Gcc 4.2.4\\
\hline
\textbf{Version Controler} & Subversion\\
\hline
\end{tabular}
\end{center}

\item \textbf{How to Use}

\begin{description}
\item[4.1] \textbf{Running On Console}\\
\begin{verbatim}
1)When starts the kh-shell, it gets evironment variables from config file
kong@kong-desktop:~/kh-shell$ ./kh-shell 

	Wellcome to Use kh-shell
	Version: 1.0.1
	Author: Kong

kong@/home/kong/kh-shell-> 
\end{verbatim}
\item[4.2] \textbf{Quit}\\
\begin{verbatim}
1) exit to quit

kong@/home/kong/kh-shell-> exit
kong@kong-desktop:~/kh-shell$ 
\end{verbatim}
\item[4.3] \textbf{Change Prompt}\\
\begin{verbatim}
1) chgpmt to change prompt, one argument needed
kong@/home/kong/kh-shell-> chgpmt $
kong@/home/kong/kh-shell$ chgpmt '->'
kong@/home/kong/kh-shell->

The prompt will be stored into the config file and be read next starting.
Everything between '' is considered a string. 
\end{verbatim}
\item[4.3] \textbf{Job Schedule}\\
\begin{verbatim}
1) & to put job into background

kong@/home/kong/kh-shell-> sleep 20 &
job[1]	<sleep 20 > running background...
kong@/home/kong/kh-shell-> job[1]	Done!
kong@/home/kong/kh-shell-> wc < hello &
job[1]	<wc > running background...
kong@/home/kong/kh-shell->  7 14 66
job[1]	Done!
kong@/home/kong/kh-shell-> find / -iname "hello" &                         
job[1]	<find / -iname "hello" > running background...
kong@/home/kong/kh-shell-> find: /etc/ssl/private: Permission denied
find: /etc/cups/ssl: Permission denied
find: /sys/fs/fuse/connections/2: Permission denied
.
.
.

grep -nr "kh-shell" / &
job[2]	<grep -nr "kh-shell" / > running background...
kong@/home/kong/kh-shell-> grep: /dev/vcsa1: Permission denied
grep: /dev/vcs1: Permission denied
find: /home/kong/.dbus: Permission denied
find: /home/kong/.kde: Permission denied
.
.
.

kong@/home/kong/kh-shell-> find: /sys/fs/fuse/connections/2: Permission denied
find: /var/lib/gdm: Permission denied
.
.
.

job[2]	Done!
job[1]	Done!


2) fg to put job running background into frontground
kong@/home/kong/kh-shell-> grep -nr "kh-shell" /home/kong/programs &
job[1]	<grep -nr "kh-shell" /home/kong/programs > running background...
kong@/home/kong/kh-shell-> /home/kong/programs/kh-shell/src/makefile:1:# Makefile for kh-shell for Linux
.
.
.

/home/kong/programs/kh-shell/src/makefile:5:PROJECT_NAME	= kh-shell
fg
/home/kong/programs/kh-shell/src/kh-shell.c:3: * File name: kh-shell.c
.
.
.

/home/kong/programs/chdir_.c:9:  if (chdir("kh-shell") < 0) {
job[1]	Done!
kong@/home/kong/kh-shell->

3) fg expects no or one arumenst
kong@/home/kong/kh-shell-> fg 3
no job running backgroud
kong@/home/kong/kh-shell-> fg 1 2 3
kh-shell: fg: has too many arguments
\end{verbatim}
\item[4.4] \textbf{Input Redirection}\\
\begin{verbatim}
1) < to redirect the standard input
kong@/home/kong/kh-shell-> cat <hello
1. First	Line
2. Second	Line
3. Third	Line

N. Nth		Line

The end
kong@/home/kong/kh-shell-> wc <hello
 7 14 66

2) < expects one right argumenst
kong@/home/kong/kh-shell-> wc <
kh-shell: <: need one argument
\end{verbatim}
\item[4.5] \textbf{Output Redirection}\\
\begin{verbatim}
1) > to redirect the standard output
kong@/home/kong/kh-shell-> wc <hello >lines_and_words
kong@/home/kong/kh-shell-> cat lines_and_words
 7 14 66

2) > expects one right argumenst
kong@/home/kong/kh-shell-> wc <hello >
kh-shell: >: need one argument

\end{verbatim}
\item[4.6] \textbf{Change Current Work Directory}\\
\begin{verbatim}
1) cd to change current work directory

kong@/home/kong/kh-shell-> pwd
/home/kong/kh-shell
kong@/home/kong/kh-shell-> cd .
kong@/home/kong/kh-shell-> pwd
/home/kong/kh-shell
kong@/home/kong/kh-shell-> cd ..
kong@/home/kong-> pwd
/home/kong
kong@/home/kong-> cd /var/www
kong@/var/www-> pwd
/var/www
kong@/var/www-> cd /The_directory_does_not_exists
kh-shell : No such file or directory
kong@/var/www-> 
\end{verbatim}
\item[4.7] \textbf{Other commands}\\
\begin{verbatim}
All most all unix commands can be executed on kh-shell

1) 
kong@/home/kong/kh-shell-> ps
  PID TTY          TIME CMD
 8942 pts/1    00:00:00 bash
 9420 pts/1    00:00:00 kh-shell
 9421 pts/1    00:00:00 ps
 
2) 
kong@/home/kong/kh-shell-> top

top - 16:20:40 up  7:52,  5 users,  load average: 2.17, 1.86, 1.76
Tasks: 137 total,   3 running, 134 sleeping,   0 stopped,   0 zombie
Cpu(s): 37.0%us, 42.4%sy,  0.0%ni, 20.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2067360k total,  2022012k used,    45348k free,   233748k buffers
Swap:  1020088k total,    40512k used,   979576k free,   737128k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 8719 kong      20   0  131m  47m  28m S   99  2.3  87:20.46 ld-linux.so.2      
 8686 kong      20   0  377m 311m  19m R   55 15.4  49:04.17 VirtualBox         
 5340 root      20   0  517m 163m  14m S    4  8.1  24:02.21 Xorg               
 7670 kong      20   0  173m  47m  22m S    2  2.4   7:28.94 rhythmbox  
 .
 .
 .
     8 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/1 
     
3)
kong@/home/kong/kh-shell-> vim hello
kong@/home/kong/kh-shell->  

4)
kong@/home/kong/kh-shell-> printf hello\n
hello

5)
kong@/home/kong/kh-shell-> echo hi
hi

6) 
kong@/home/kong/kh-shell-> awk
kong@/home/kong/kh-shell-> 

7)
kong@/home/kong/kh-shell-> kill
Usage:
  kill pid ...              Send SIGTERM to every process listed.
  kill signal pid ...       Send a signal to every process listed.
  kill -s signal pid ...    Send a signal to every process listed.
  kill -l                   List all signal names.
  kill -L                   List all signal names in a nice table.
  kill -l signal            Convert between signal numbers and names.

8)
kong@/home/kong/kh-shell-> man bash
kong@/home/kong/kh-shell-> 

9)
kong@/home/kong/kh-shell-> VirtualBox
kong@/home/kong/kh-shell-> 

10)
kong@/home/kong/kh-shell-> python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
kong@/home/kong/kh-shell-> 
\end{verbatim}
\end{description}

\end{enumerate}
\end{document}
